﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace LevelEditor
{
    class Map
    {
        #region Attributes
        public int width;
        public int height;
        public String mapName;
        public String mapPath;
        #endregion

        #region Properties
        public int Width
        {
            get { return width; }
            set { width = value; }
        }
        public int Height
        {
            get { return height; }
            set { height = value; }
        }
        public String MapName
        {
            get { return mapName; }
            set { mapName = value; }
        }
        public String MapPath
        {
            get { return mapPath; }
            set { mapPath = value; }
        }
        #endregion

        public Map()
        {
            width = 0;
            height = 0;
            mapName = "";
        }
        public Map(int width, int height, String mapName)
        {
            Width = width;
            Height = height;
            MapName = mapName;
        }
        public Map(String mapPath)
        {
            MapPath = mapPath;
            StreamReader reader = new StreamReader(MapPath);
            mapName = reader.ReadLine();
            String size = reader.ReadLine();
            String[] sizes = new String[2];
            sizes = size.Split(',');
            Width = int.Parse(sizes[0]);
            Height = int.Parse(sizes[1]);
            reader.Close();
        }
    }
}
